//
//  NSString+XSBase64.m
//  WB
//
//  Created by Cedar on 16/10/17.
//  Copyright © 2016年 Cedar. All rights reserved.
//

#import "NSString+XSBase64.h"

@implementation NSString (XSBase64)

- (NSString *)xs_base64Encode {
    
    NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding];
    
    return [data base64EncodedStringWithOptions:0];
}
    
- (NSString *)xs_base64Decode {
    
    NSData *data = [[NSData alloc] initWithBase64EncodedString:self options:0];
    
    return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
    
@end
